package lucene.search
{
	import lucene.document.Document;
	
	public class QueryHit
	{
		private var _index:IReader;
		private var _document:*		
		
		public var id;
		public var score;
		
		public function QueryHit(index:IReader)
		{
			this._index = index;
		}

		public function getDocument():Document
		{
			if(this._document == null) {
				this._document = this._index.getDocument(this.id);
			}
			
			return this._document;
		}

		public function getIndex():IReader
		{
			return this._index;
		}

	}
}